home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / utility / appshl.zip / APPSHELL.C < prev    next >
C/C++ Source or Header  |  1991-08-10  |  2KB  |  77 lines

  1. // ================
  2. // Copyrights & CYA
  3. // ================
  4. //
  5. // App Shell is freeware with the following intent:
  6. //
  7. // -  You are free to incorporate App Shell into your code that will be
  8. //    distributed in executable form.
  9. // -  You are free to distribute App Shell source or incorporate App Shell
  10. //    source into your source code assuming no charge is required and this
  11. //    copyright is maintained and acknowledged.
  12. // -  You are free to distribute App Shell source as shareware assuming
  13. //    you are an approved vendor and associate member of the Association
  14. //    of Shareware Professionals (ASP).  No registration fee is required
  15. //    but this copyright must be maintained and acknowledged.
  16. // -  All other distribution rights are maintained by the author.
  17. // -  The author makes NO warranties, express or implied, oral or written,
  18. //    including any implied warranties of merchantability or fitness for
  19. //    a particular purpose.  In no event shall the author be liable for
  20. //    any damages whatsoever arising out of the use of the software.
  21. //
  22. // If you find any bugs, anomalies, or have any questions or suggestions,
  23. // please send them to Jim Presley (CIS ID - 73417,2674).  Enjoy!
  24. //
  25. //
  26. #include <windows.h>
  27. #include <drivinit.h>
  28.  
  29. int far PASCAL _export AppShellPrSetup(HANDLE hWnd, LPSTR pPN, LPSTR pPD, LPSTR pPP )
  30. {
  31.   FARPROC lpfnExtDeviceMode;
  32.   FARPROC lpfnDeviceMode;
  33.   HANDLE  hDriver;
  34.   int     rc;
  35.  
  36.   rc = 0;
  37.   hDriver = LoadLibrary( pPD );
  38.   lpfnExtDeviceMode = GetProcAddress( hDriver, "ExtDeviceMode" );
  39.  
  40.   if ( lpfnExtDeviceMode != NULL )
  41.   {
  42.     (*lpfnExtDeviceMode)(
  43.        (HWND)   hWnd,
  44.        (HANDLE) hDriver,
  45.        NULL,
  46.        (LPSTR)  pPN,
  47.        (LPSTR)  pPP,
  48.        NULL,
  49.        NULL,
  50.        DM_IN_PROMPT);
  51.     rc = -1;
  52.   }
  53.   else
  54.   {
  55.     lpfnDeviceMode = GetProcAddress( hDriver, "DeviceMode" );
  56.  
  57.     if ( lpfnDeviceMode != NULL )
  58.     {
  59.       (*lpfnDeviceMode)(
  60.           (HWND)    hWnd,
  61.           (HANDLE)  hDriver,
  62.           (LPSTR)   pPN,
  63.           (LPSTR)   pPP );
  64.       rc = -1;
  65.     }
  66. }
  67.  
  68.   FreeLibrary( hDriver );
  69.   return rc;
  70.  
  71. }
  72.  
  73. int FAR PASCAL LibMain( HANDLE hInstance, WORD wDataSet, WORD cbHeapSize, LPSTR lpszCmdLine)
  74. {
  75.   return(1);
  76. }
  77.